﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Services;
using WLMCoreLibrary;
using SAW_Core;

namespace SAW.webservices
{
    /// <summary>
    /// Summary description for POSUpdateService
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]

    public class POSUpdateService : System.Web.Services.WebService
    {

        [WebMethod]
        public List<Producto> GetProductList()
        {
            dbConnector ConexionDB = new dbConnector();
            ProductoCollection listaProductos = new ProductoCollection(ref ConexionDB);
            List<Producto> lista = new List<Producto>();
            foreach (Producto prod in listaProductos.Elementos)
                lista.Add(prod);
            ConexionDB.CloseConnection();
            return lista;
        }
    }
}
